


import java.util.Comparator;
import java.util.HashMap;


public class RWComparator implements Comparator<Integer> {
	private HashMap<Integer, Integer> reachedNum;
	
	public RWComparator(HashMap<Integer, Integer> reachedNum) {
		this.reachedNum = reachedNum;
	}

	@Override
	public int compare(Integer o1, Integer o2) {
		int n1 = reachedNum.get(o1);
		int n2 = reachedNum.get(o2);
		if(n1 > n2)
			return -1;
		else if(n1 < n2)
			return 1;
		else
					
			return 0;
	}

}
